package com.lwm.date;

import org.junit.Test;

import java.util.Calendar;
import java.util.Date;

/**
 * @author liweimin
 * @date 2020/10/15 15:11
 * @description
 */
public class ClaendarTest {
    //创建子类
    //调用静态方法
    @Test
    public void test01(){
        Calendar instance = Calendar.getInstance();
        int i = instance.get(Calendar.DAY_OF_MONTH);
        System.out.println(i);
        instance.set(Calendar.DAY_OF_MONTH,18);
    }
    @Test
    public void test02(){
        Date date = new Date();
        System.out.println(date);
        /**
         * Calendar.set(year + 1900, month, date)
         * 月份从0开始
         */
        Date date1 = new Date(2020, 9, 8);
    }
}
